home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MATHS
/
RLAB
/
RLAB125.ZIP
/
!RLaB
/
rlib
/
rank
< prev
next >
Wrap
Text File
|
1994-09-20
|
626b
|
28 lines
//-------------------------------------------------------------------//
//
// Syntax: rank ( A )
// rank ( A , tol )
// Description:
// Compute the rank of the matrix A. Rank returns the number of
// singular values that are larger than:
// max( size(x) ) * norm(x,"2") * eps.
// If the user specifies tol, the the number of singular values
// larger than tol is returned.
//-------------------------------------------------------------------//
rank = function(x, tol)
{
global (eps)
s = svd(x);
if (!exist (tol))
{
tol = max(size(x)) * norm(x,"2") * eps;
}
return sum(s.sigma > tol);
};